﻿<Window x:Class="DataBinding.DataTemplateControls"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="DataTemplateControls" Height="341" Width="288"
    >
  <Grid>
    <ListBox Grid.Row="1" Margin="10" Name="lstCategories" HorizontalContentAlignment="Stretch">
      <ListBox.ItemTemplate>
        <DataTemplate>
          <Grid Margin="3">
            <Grid.ColumnDefinitions>
              <ColumnDefinition></ColumnDefinition>
              <ColumnDefinition Width="Auto"></ColumnDefinition>
            </Grid.ColumnDefinitions>            
            <TextBlock VerticalAlignment="Center"  Text="{Binding Path=CategoryName}"></TextBlock>
            <Button Grid.Column="1" Padding="2"
                    Click="cmdView_Clicked" Tag="{Binding}">View ...</Button>            
            </Grid>
          </DataTemplate>
        </ListBox.ItemTemplate>
      </ListBox>
    </Grid>
</Window>
